package org.oliver.crp.samtrack.client.ui.widgets;

import org.oliver.crp.samtrack.client.ui.data.SampleData;

import com.google.gwt.core.client.GWT;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;

public class ContextAreaListGrid extends ListGrid{
	
	public ContextAreaListGrid() {
		super();
		
		GWT.log("init ContextAreaListGrid()...", null);
		
		this.setShowAllRecords(true);
		this.setSortField(1);
		
		ListGridField iconField = new ListGridField("icon", "#", 27);
		iconField.setImageSize(16);
		iconField.setAlign(Alignment.CENTER);
		iconField.setType(ListGridFieldType.IMAGE);  
		iconField.setImageURLPrefix("icons/16/");  
		iconField.setImageURLSuffix(".png");	
		
		ListGridField sampleNumber = new ListGridField("sampleNumber", "Sample Number", 180);
		ListGridField species = new ListGridField("species", "Species", 220);
		ListGridField description = new ListGridField("description", "Description", 220);
		ListGridField collectionDate = new ListGridField("collectionDate", "Collection Date", 180);
		ListGridField responsible = new ListGridField("responsible", "Responsible", 180);
		
		ListGridField emptyField = new ListGridField("emptyField", "");
		
		this.setFields(new ListGridField[] {iconField, sampleNumber, species, description, collectionDate, responsible});
		
		this.setData(SampleData.getSamples());
	}

}
